<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue2.6.12.js" type="text/javascript" charset="utf-8"></script>
	
	</head>
	<body>
		<div id="app">
			<div id="">
					<ul>
						<li v-for="(item,index) in lists" :style=" cur == index ? curColor:''" @mouseover="mo(index)">{{item}}</li>
					</ul>
			</div>
			<div id="">
				<button type="button" @click="cl">点击</button>
				
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var vm= new Vue({
			el:'#app',
			data:{
				cur:'',
				curColor:{'background':''},
				lists:['第1行','第2行','第3行','第4行','第5行','第6行','第7行','第8行','第9行','第10行'],
				
			},
			methods:{
				mo(index){
					let x=Math.floor(Math.random(0,255)*256);
					let y=Math.floor(Math.random(0,255)*256);
					let z=Math.floor(Math.random(0,255)*256);
					this.cur=index;
					this.curColor.background='rgb('+x+','+y+','+z+')';
				},
				cl:()=>{
					console.log(111);
				}
			}
		})
	</script>
</html>
